//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package study.IO.字符流.Reader;

import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;

public class InputStreamReader_demo {
    public InputStreamReader_demo() {
    }

    public static void main(String[] args) throws IOException {
        InputStreamReader isr = new InputStreamReader(new FileInputStream("JavaTest\\Files\\gbk.txt"), "GBK");

        int c;
        while((c = isr.read()) != -1) {
            System.out.print((char)c);
        }

        isr.close();
        FileReader fr = new FileReader("JavaTest\\Files\\a-copy.txt", Charset.forName("GBK"));

        int ch;
        while((ch = fr.read()) != -1) {
            System.out.print((char)ch);
        }

        fr.close();
    }
}
